<%--
  Created by IntelliJ IDEA.
  User: yutao
  Date: 2017/5/23
  Time: 10:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="../../../common/taglibs.jsp" %>
<html>
<head>
    <title>Title</title>
    <script src="${ctx}/js/views/settlement/clear/detail/mchntPayableAmtManage.js"></script>
</head>
<body ng-app="myApp" style="overflow:scroll;overflow-x:hidden">
    <core:import url="../../../common/pageHead.jsp">
        <core:param name="title" value="商户应付款结算管理"/>
    </core:import>
    <div ng-controller="queryCtrl" class="container-fluid">
        <form id="queryForm" name="queryForm" action="${ctx}/mchnt/mchntPayableAmtManage/search" class="form-inline" autocomplete="off">
            <table table-detail>
                <tr>

                    <td class="text-right">
                        商户代码
                    </td>
                    <td>
                        <input type="text" ng-model="vm.queryBean.orgCode" class="{{vm.constant.inputClass}}"
                               typeahead-min-length="0" uib-typeahead="item.key as item.value for item in vm.getCache('MERCHANT_CODE') | filter:$viewValue | limitTo:6"/>
                    </td>
                    <td class="text-right">
                        结算状态
                    </td>
                    <td class="text-right">
                        <select ng-model="vm.queryBean.clrStatus" class="{{vm.constant.inputClass}}"
                                ng-options="key as value for (key,value) in {'0':'未结算','1':'已结算'}">
                            <option value="">请选择</option>
                        </select>
                    </td>
                    <td class="text-right">
                        截止实付日期
                    </td>
                    <td class="text-right">
                        <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                               ng-model="vm.queryBean.bankTransPayDate">
                    </td>
                </tr>
                <tr>
                    <td class="text-right">
                        清算日期
                    </td>
                    <td>
                        <input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                               ng-model="vm.queryBean.queryStartDate"
                               required/>
                    </td>
                    <td>
                        -&nbsp;<input type="text" class="{{vm.constant.inputClass}}" uib-datepicker-popup="yyyy-MM-dd"
                                      ng-model="vm.queryBean.queryEndDate"  required/>
                    </td>
                </tr>
                <tr>
                    <td colspan="8" class="textCenter">
                        <button type="button" ng-disabled="queryForm.$invalid" ng-click="vm.queryDetail()" class="btn btn-default">查询</button>
                        <button type="button" ng-click="vm.resetForm()" class="btn btn-default">重置</button>
                        <button type="button" ng-disabled="queryForm.$invalid" down-file="${ctx}/mchnt/mchntPayableAmtManage/download" params="vm.queryBean"
                                down-file-type="xls" class="btn btn-default">
                            下载
                        </button>
                    </td>
                </tr>
            </table>
        </form>
        <div>

            <table table-detail>
                <thead>
                <tr>
                    <th>外部清算日期</th>
                    <th>商户名称</th>
                    <th>类型</th>
                    <th>销账净额（元）</th>
                    <th>结算状态</th>
                    <th>确认日期</th>
                    <th>实付日期</th>
                </tr>
                </thead>
                <tbody ng-repeat="bean in vm.pagination.list track by $index">
                    <td>{{bean.transDate | date:'yyyy-MM-dd'}}</td>
                    <td>{{vm.cached.MERCHANT_CODE[bean.orgCode + '']}}({{bean.orgCode}})</td>
                    <td>{{{'0':'邮局','1':'非邮局'}[bean.type]}}</td>
                    <td>{{(bean.payableAmt - bean.receivableAmt)/100 | currency:''}}</td>
                    <td>{{{'0':'未结算','1':'已结算'}[bean.clrStatus]}}</td>
                    <td>{{bean.confirmTime | date:'yyyy-MM-dd'}}</td>
                    <td>{{bean.bankTransPayDate | date:'yyyy-MM-dd'}}</td>
                </tbody>

                <tfoot>
                <tr>
                    <td colspan="3" class="text-right">总计：</td>
                    <td class="text-center">{{vm.sumObject/100 | currency:''}}</td>
                </tr>
                </tfoot>
            </table>
        </div>
        <core:import url="../../../common/pageFoot.jsp"/>
    </div>
    <core:import url="../../../common/nav.jsp"/>
</body>
</html>
